package com.sgb.net.core;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * @author: 杨畔
 * @date: 2021/2/20 10:12
 * @Description: 网络请求封装基类(兼容)
 */
public abstract class BaseCompatibleNet extends BaseNet {
    @Override
    public <S> S getService(Class<S> serviceClass, String baseUrl) {
        return new Retrofit.Builder()
                .client(mClient)
                .addConverterFactory(GsonConverterFactory.create())
                .baseUrl(baseUrl)
                .build()
                .create(serviceClass);
    }
}
